odoo.define('web_optimize.HierarchyView', function (require) {
"use strict";

var AbstractView = require('web.AbstractView');
var core = require('web.core');
var view_registry = require('web.view_registry');
var HierarchyModel = require('web_optimize.HierarchyModel');
var HierarchyController = require('web_optimize.HierarchyController');
var HierarchyRenderer = require('web_optimize.HierarchyRenderer');

var _lt = core._lt;


var HierarchyView = AbstractView.extend({
    display_name: _lt('Hierarchy'),
    icon: 'fa-tree',
    jsLibs: [
        '/web_optimize/static/lib/go.js',
    ],
    config: _.extend({}, AbstractView.prototype.config, {
        Model: HierarchyModel,
        Controller: HierarchyController,
        Renderer: HierarchyRenderer,
    }),
    viewType: 'hierarchy',
    searchMenuTypes: ['filter','comparison', 'favorite'],

    /**
     * @override
     */
    init: function (viewInfo, params) {
        this._super.apply(this, arguments);
        this.$$ = go.GraphObject.make;
        this.rendererParams.$$ = this.$$;
        this.rendererParams.modelName = params.modelName;
        this.rendererParams.action = params.action;
        this.rendererParams.hierarayWidget = this.arch.attrs.widget;
    }
});

view_registry.add('hierarchy', HierarchyView);

return HierarchyView;

});
